﻿namespace UnityEditor
{
    using System;
    using UnityEngine;

    [Serializable]
    internal class AnimVector3 : AnimValue
    {
        [SerializeField]
        private Vector3 m_Value;

        public AnimVector3()
        {
            this.m_Value = new Vector3();
        }

        public AnimVector3(Vector3 val)
        {
            this.m_Value = val;
        }

        public static implicit operator Vector3(AnimVector3 v)
        {
            return v.m_Value;
        }

        internal override void Update()
        {
            this.m_Value = Vector3.Lerp((Vector3) base.m_Source, this.target, base.smoothed);
        }

        public Vector3 target
        {
            get
            {
                return (Vector3) base.GetTarget(this.m_Value);
            }
            set
            {
                base.BeginAnimating(value, this.m_Value);
            }
        }

        public Vector3 value
        {
            get
            {
                return this.m_Value;
            }
            set
            {
                this.m_Value = value;
                base.StopAnim(value);
            }
        }
    }
}

